package chat;

import javax.sound.sampled.LineUnavailableException;

public class VoiceChat {
	Transmitter tx;
	Receiver rx;
	String senderIp;
	
	
	public VoiceChat (String ip) {
		senderIp = ip;
		try {
			Receiver rx = new Receiver();
			rx.start();
		} catch (Exception e) {}
	}
	
	public void stop () {
		tx.stop();
		rx.stopAll();
	}

	public void startTransmitter() {
		Transmitter tx = new Transmitter(senderIp);
		try {
			tx.captureAudio();
		} catch (Exception e) {
			
		}
	}
}
